package com.example.easyexcel.yibuces;

import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

import java.util.concurrent.TimeUnit;

/**
 * @Author wxc
 * @Date 2021/4/16 15:59
 */
@Component
public class Task234 {

    @Async
    public void doTaskOne() throws InterruptedException {
        System.out.println("doTaskOne start " + System.currentTimeMillis());
        TimeUnit.SECONDS.sleep(3);
        System.out.println("doTaskOne end " + System.currentTimeMillis());
    }

    @Async
    public void doTaskTwo() throws InterruptedException {
        System.out.println("doTaskTwo start " + System.currentTimeMillis());
        TimeUnit.SECONDS.sleep(3);
        System.out.println("doTaskTwo end " + System.currentTimeMillis()) ;
    }
}